api ={
    //获取当前时间
    GetDate:function () {
        var date=new Date()
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        m = m < 10 ? ('0' + m) : m;
        var d = date.getDate();
        d = d < 10 ? ('0' + d) : d;
        var h = date.getHours();
        h=h < 10 ? ('0' + h) : h;
        var minute = date.getMinutes();
        minute = minute < 10 ? ('0' + minute) : minute;
        var second=date.getSeconds();
        second=second < 10 ? ('0' + second) : second;
        return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second;
    },
    test:function () {
        console.log("hello,word");
    }
}


//计时初始化
var hour,minute,second;//时 分 秒
hour=minute=second=0;//初始化

//计时
function Timer(){
    var h,m,s;
    second++;
    if(second>=60){
        second=0;
        minute=minute+1;
    }

    if(minute>=60){
        minute=0;
        hour=hour+1;
    }

    var h=hour< 10 ? 0+''+hour : hour;
    var m=minute < 10 ? 0+ ''+minute : minute;
    var s=second < 10 ? 0+ ''+second :second;
    return h+':'+m+':'+s;
}